home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998…tember: Reference Library / Dev.CD Sep 98 RL1.toast / Technical Documentation / develop / develop Issue 27 / develop Issue 27 code / Internet Config Assistant / InternetAssistant / TMapView.h < prev   
Encoding:
C/C++ Source or Header  |  1996-05-02  |  1.4 KB  |  75 lines  |  [TEXT/CWIE]

  1. /*
  2.   File:            TMapView.h
  3.  
  4.   Contains:        Class implementing a map location selector
  5.  
  6.   Written by:     Arno Gourdol
  7.  
  8.   Copyright:    Copyright 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11.  
  12. #pragma once
  13.  
  14. #ifndef    __TMAPVIEW__
  15. #define    __TMAPVIEW__
  16.  
  17. #include "TDrawContext.h"
  18. #include "TBitmap.h"
  19.  
  20.  
  21.  
  22. typedef struct RgnLResourceEntry
  23. {
  24.     short    pictureID;
  25.     short    value;
  26. } RegionValueRec;
  27.  
  28.  
  29. struct RgnLResource
  30. {
  31.     UInt16 regionCount;
  32.     RgnLResourceEntry regions[1];
  33. };
  34.  
  35. typedef struct RgnLResource RgnLResource, **RgnLResourceHandle;
  36.  
  37.  
  38.  
  39. class TMapView
  40. {
  41. public:
  42.     // constructor
  43.     TMapView(SInt16 mapID, SInt16 hiliteMapID, SInt16 colorMapID, 
  44.                 SInt16 colorHiliteMapID, SInt16 regionListID);
  45.     
  46.     // destructor
  47.     ~TMapView();
  48.  
  49.     // events
  50.     void Draw(const TDrawContext& drawContext, const CRect& frame) const;
  51.     void MouseDown(CRect bounds);
  52.     void Pulse(void);
  53.  
  54.     // getters
  55.     SInt16 FindRegion(CPoint location);
  56.     SInt16 GetValue(void);
  57.     
  58.     // setters
  59.     void SetValue(SInt16 value);
  60.  
  61. private:
  62.     TBitmap* fColorMap;            // Bitmap of the regular map
  63.     TBitmap* fColorHilitedMap;    // Bitmap of the hilited map
  64.     TBitmap* fMap;                // Bitmap of the regular map (B&W)
  65.     TBitmap* fHilitedMap;        // Bitmap of the hilited map (B&W)
  66.  
  67.     SInt16 fSelectedRegion;        // Index in fRegions or -1
  68.  
  69.     UInt16 fNumRegions;            // Number of regions
  70.     struct Region { RgnHandle region; SInt16 value; SInt16 pictureID; } *fRegions;
  71. };
  72.  
  73.  
  74. #endif
  75.